Skip to main content

FormInstance

The FormInstance class manages a form instance, providing properties and methods for handling form settings, secrets, user events, deployment URL configurations, and controls. It integrates encryption and decryption for secure management of SecretKey and other sensitive data.

Properties

NameDescription
SecretKeyHandles the encrypted secret key for the form, managing decryption and merging parameters if necessary.
AgentModeIndicates if the form operates in agent mode, adjusting behavior and URL configurations for agent-based resources.
ProjectNameThe name of the project associated with this form instance.
SecretObjectDecrypts and returns the FormSecret object associated with the current SecretKey.
FormNameThe name of the form associated with this instance.
UserEventHolds the user event information relevant to this form instance.
VersionSpecifies the version of the form, with a default value of "latest".
ParametersContains a collection of parameters used within the form instance, initialized as an empty dictionary.
ClientFormRepresents the client form data model linked to this form instance.
DeploymentUrlGenerates the deployment URL based on AgentMode, using a formatted string if agent mode is active, otherwise returning the standard deployment URL.
ControlsA collection of form controls associated with this form instance, excluding JSON serialization.

Constructors

NameDescription
FormInstance(projectName, formName, secretKey, agentMode, serviceAPI)Creates a new form instance with the specified parameters.
FormInstance(projectName, formName, secretKey, serviceAPI)Creates a new form instance with the specified parameters.
FormInstance(projectName, formName, secretKey)Creates a new form instance with the specified parameters.
FormInstance(projectName, formName, serviceAPI)Creates a new form instance with the specified parameters.

Methods

NameDescription
Initialize(createForm, telemetryCollectorHolder)Initializes the form instance, optionally creating the form if specified.
GetRelatedDocumentObjectsV2(objectRequestSecretKeys, telemetryCollectorHolder)Retrieves a list of related document objects based on the provided secret keys for object requests.
Save(telemetryCollectorHolder)Saves the form instance by calling the SaveForm method.
Release(formStateId, telemetryCollectorHolder)Releases the specified form state by its ID.
CreateWithDocumentData(documentData, telemetryCollectorHolder)Creates a form instance with the provided document data.
MergeData(controlValues, telemetryCollectorHolder)Merges the provided control values into the form instance controls.
SetFormInstanceIntialParameters(serviceAPI, telemetryCollectorHolder)Sets the initial parameters for the form instance by initializing the FormManagerAPI and ServiceAPI properties and loading the necessary initial parameters.
DeleteDocument(documentId, telemetryCollectorHolder)Deletes a document based on the provided document ID.
CheckColumnsIsUnique(documentId, controlName, rows, telemetryCollectorHolder)Checks whether the specified columns are unique in the provided grid data.
SaveAsDraft(starterInfo, telemetryCollectorHolder)Saves the form instance as a draft by calling the SaveAsDraftForm method.
Run(telemetryCollectorHolder)Executes the form instance by calling the RunForm method.
InitializeWithoutView(telemetryCollectorHolder)Initializes the form instance without creating a view, performing necessary initializations.
BatchCreateWithDocumentData(documentsData, telemetryCollectorHolder)Creates multiple form instances with the provided list of document data.
GetRelatedDocumentObjects(objectIds, telemetryCollectorHolder)Retrieves a list of related document objects based on the provided object IDs.
SetControlValue(key, value , telemetryCollectorHolder)Sets the value of a specific control in the form instance.
GetFileSelectorObjects(objectIds, telemetryCollectorHolder)Retrieves a list of file selector objects based on the provided object IDs.
UpdateStatus(documentId, status, telemetryCollectorHolder)Updates the status of a document based on the provided document ID and status.
GetControlValue(documentId, controlName, telemetryCollectorHolder)Retrieves the value of a specific control in the form instance.
GetFileSelectorObjectsV2(objectRequestSecretKeys, telemetryCollectorHolder)Retrieves a list of file selector objects based on the provided object request secret keys.
SetUniqueId(documentId, uniqueId, telemetryCollectorHolder)Sets a unique ID for the specified document.